﻿<%@ Page Title="業務システム - 手配追加" Language="vb" AutoEventWireup="false" MasterPageFile="../CM/MainMaster.Master"
    CodeBehind="KJ0020P02.aspx.vb" Inherits="Tohto.KJ0020P02" %>

<%@ Import Namespace="Tohto.Base.CommonConst" %>
<%@ Register Assembly="Tohto.Base.CustomControl" Namespace="Tohto.Base.CustomControl"
    TagPrefix="cc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Import Namespace="Tohto.Base.ComUtility" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">

     function KakuninnCheck() {
         ClearErrorBg();
             
         var tehai_date=$("#<%=txt_date.ClientId%>");
         
         
         <%If CBool(Session(ComConst.GAMEN_ID.TEHAI_TUIKA & _KOJI_KB).Equals("001")) Then%>            
         var owner_hokoku_dt=$("#<%=txt_owner_hokoku_dt.ClientId %>");
         if (!checkNull(owner_hokoku_dt.val())) {
             //事前オーナー報告日の日付の検証を行います
             if (!validateDate(owner_hokoku_dt.val())) {
                 SetErrorArea("CME0059",'事前オーナー報告日','yyyy/mm/dd', '', '');
                 owner_hokoku_dt.focus(); 
                 owner_hokoku_dt.addClass("errorRed");
                 return false;
              }
         }
                 
         var txt_owner_shodaku_dt=$("#<%=txt_owner_shodaku_dt.ClientId %>");
         if (!checkNull(txt_owner_shodaku_dt.val())) {
             //事前オーナー承諾日の日付の検証を行います
             if (!validateDate(txt_owner_shodaku_dt.val())) {
                 SetErrorArea("CME0059",'事前オーナー承諾日','yyyy/mm/dd', '', '');
                 txt_owner_shodaku_dt.focus();
                 txt_owner_shodaku_dt.addClass("errorRed");
                 return false;
              }
         }
         <%End If%>
                                                              
         var tehai_shubetu_1 = $("#<%=kj0020p02_dropDown_tehai_shubetu.ClientId%>").val();
         var tehai_shubetu = $("#<%=kj0020p02_dropDown_tehai_shubetu.ClientId%>")
         var kanryo_yt_dt =$("#<%=txt_kanryo_yt_dt.ClientId%>"); 
         if ((tehai_shubetu_1 == "01") || (tehai_shubetu_1 == "02")) {
             if (checkNull(kanryo_yt_dt.val())) {
                   SetErrorArea("CME0060",'完了予定日','', '');
                   kanryo_yt_dt.focus();
                   kanryo_yt_dt.addClass("errorRed");
                   return false;        
             }      
         } 

         if (tehai_shubetu_1 == "") {
                   SetErrorArea("CME0060",'手配種別','', '');
                   tehai_shubetu.focus();
                   tehai_shubetu.addClass("errorRed");
                   return false;        
         }      

         var gyosha_cd=$("#<%=txt_gyosha_cd.ClientId%>");
         if (checkNull(gyosha_cd.val())) {
             //業者cdが必須入力且つ、数字が必須
             SetErrorArea("CME0060",'業者cd','', '');
             gyosha_cd.focus();
             gyosha_cd.addClass("errorRed");
             return false;
         } else if (!isNum(gyosha_cd.val())) {
             //業者cdが数字必須
             SetErrorArea("CME0059",'業者cd','', '');
             gyosha_cd.focus();
             gyosha_cd.addClass("errorRed");
             return false;  
         }
      
         var tel=$("#<%=txt_tel.ClientId%>");
         if (!checkNull(tel.val())) {
             //telが数字必須
             if (!isNum(tel.val())) {
                 SetErrorArea("CME0059",'tel','数字','', '');
                 tel.focus();
                 tel.addClass("errorRed");
                 return false;  
              }
         }
      
         var fax=$("#<%=txt_fax.ClientId%>");
         if (!checkNull(fax.val())) {
             //faxが数字必須
             if (!isNum(fax.val())) {
                 SetErrorArea("CME0059",'fax','数字','', '');
                 fax.focus();
                 fax.addClass("errorRed");
                 return false;  
              }
         }
     
         var room_cd=$("#<%=txt_room_cd.ClientId%>");
         if (!checkNull(room_cd.val())) {
             //部屋コードが数字必須
             if (!isNum(room_cd.val())) {
                 SetErrorArea("CME0059",'部屋コード','数字','', '');
                 room_cd.focus();
                 room_cd.addClass("errorRed");
                 return false;  
              }
         }
      
         var renraku_tel=$("#<%=txt_renraku_tel.ClientId%>");
         if (!checkNull(renraku_tel.val())) {
             //電話番号が数字必須
             if (!isNum(renraku_tel.val())) {
                 SetErrorArea("CME0059",'電話番号','数字','', '');
                 renraku_tel.focus();
                 renraku_tel.addClass("errorRed");
                 return false;  
              }
         }

         return true;          
     }

     /* 業者参照 */
     function TantoSansyo() {
         var returnValue = ShowMDialog("../UT/UT0010P01.aspx", dialog_tantosya);
         if (returnValue != null) {
             $("#<%=txt_gyosha_cd.ClientId %>").val(returnValue.code);
             $("#<%=txt_gyosha_nm.ClientId %>").val(returnValue.name);
             $("#<%=txt_gyosha_cd.ClientId %>").attr("readonly", "true");
     　　    $("#<%=txt_gyosha_nm_part2.ClientId %>").attr("readonly", "true");
             $("#<%=txt_gyosha_nm_part2.ClientId %>").val("");
             return false;
         } else {
             return false;
         }
     }

     /* ページ初期化 */
     function DoReady() {
        
     }

     function StopCheck() {
         return true;
     }

     function DeleteCheck() {
         return true;
     }

    </script>
    <div id="main" class="kj0020p02_mark_place">
        <div id="kj0020p02_search_title">
            <span class="kj0020p02_sub_title_marck">◆</span><span class="kj0020p02_sub_title">手配追加</span>
        </div>
        <div id="search_main">
            <div class="kj0020p02_dis_between_table_part2">
                <table>
                    <tr>
                        <td class="label_background border_top kj0020p02_search_lable">
                            手配日
                        </td>
                        <td class="border_top noborder_left label_background k0020p02_needmark">
                            *
                        </td>
                        <td colspan="2" class="border_top white_td">
                            <asp:TextBox ID="txt_date" runat="server" MaxLength="10" TabIndex="18" CssClass="kj0020p02_ymd"></asp:TextBox>
                            <ajaxToolkit:CalendarExtender ID="tehai_dtt" CssClass="MyCalendar" runat="server"
                                DaysModeTitleFormat="yyyy/MM/dd" Enabled="True" Format="yyyy/MM/dd" PopupButtonID="btn_tehai_dt_Calendar"
                                TargetControlID="txt_date" TodaysDateFormat="yyyy/MM/dd">
                            </ajaxToolkit:CalendarExtender>
                        </td>
                        <td class="border_top">
                            <asp:Button ID="btn_tehai_dt_Calendar" CssClass="calendar_button" runat="server"
                                TabIndex="19" />
                        </td>
                        <td colspan="2" class="<%=util.objtostring(Session(ComConst.GAMEN_ID.TEHAI_TUIKA & _BORDER_BOTTOM)) %>">
                        </td>
                        <td class="noborder_bottom noborder_left">
                        </td>
                    </tr>
                    <%If CBool(Session(ComConst.GAMEN_ID.TEHAI_TUIKA & _KOJI_KB).Equals("001")) Then%>
                    <tr>
                        <td class="label_background">
                            事前オーナー報告日
                        </td>
                        <td class="label_background noborder_left">
                        </td>
                        <td colspan="3" class="white_td">
                            <asp:TextBox ID="txt_owner_hokoku_dt" runat="server" Text="9999/99/99" TabIndex="20"
                                MaxLength="10" CssClass="kj0020p02_ymd" />
                        </td>
                        <td class="label_background kj0020p02_search_lable">
                            事前オーナー承諾日
                        </td>
                        <td class="kj0020p02_owner_shodaku_dt white_td">
                            <asp:TextBox ID="txt_owner_shodaku_dt" runat="server" Text="9999/99/99" TabIndex="22"
                                MaxLength="10" CssClass="kj0020p02_ymd" />
                        </td>
                        <td class="noborder_bottom kj0020p02_owner_td">
                        </td>
                    </tr>
                    <%Else%>
                    <tr style="visibility: collapse">
                        <td class="label_background ">
                            事前オーナー報告日
                        </td>
                        <td class="label_background noborder_left">
                        </td>
                        <td colspan="3" class="white_td">
                            <asp:TextBox ID="TextBox1" runat="server" Text="9999/99/99" TabIndex="20" MaxLength="10"
                                CssClass="kj0020p02_ymd" />
                        </td>
                        <td class="label_background kj0020p02_search_lable">
                            事前オーナー承諾日
                        </td>
                        <td class="kj0020p02_owner_shodaku_dt white_td">
                            <asp:TextBox ID="TextBox2" runat="server" Text="9999/99/99" TabIndex="22" MaxLength="10"
                                CssClass="kj0020p02_ymd" />
                        </td>
                        <td class="noborder_bottom kj0020p02_owner_td">
                        </td>
                    </tr>
                    <%End If%>
                    <tr>
                        <td class="label_background">
                            手配種別
                        </td>
                        <td class="label_background noborder_left k0020p02_needmark">
                            *
                        </td>
                        <td colspan="3" class="white_td">
                            <cc:ReadOnlyDropDownList ID="kj0020p02_dropDown_tehai_shubetu" CssClass="kj0020p02_dropDown_tehai_shubetu"
                                runat="server" TabIndex="27" ReadOnlyWidth="-2">
                                <asp:ListItem Value="0">Ready</asp:ListItem>
                                <asp:ListItem Value="1">Not yet</asp:ListItem>
                                <asp:ListItem Value="2">siolink</asp:ListItem>
                                <asp:ListItem Value="3">HP</asp:ListItem>
                                <asp:ListItem Value="4">IBM</asp:ListItem>
                            </cc:ReadOnlyDropDownList>
                        </td>
                        <td colspan="3" class="noborder_right">
                        </td>
                    </tr>
                    <tr>
                        <td class="label_background">
                            工事名
                        </td>
                        <td class="label_background noborder_left">
                        </td>
                        <td colspan="6" class="border_right white_td">
                            <asp:TextBox ID="txt_koji_nm" runat="server" MaxLength="50" TabIndex="28" CssClass="kj0020p02_kouji_nm" />
                        </td>
                    </tr>
                    <tr>
                        <td class="label_background">
                            工事予定
                        </td>
                        <td class="label_background noborder_left">
                        </td>
                        <td class="kj0020p02_koji_yotei_td white_td">
                            <cc:ReadOnlyDropDownList ID="kj0020p02_koji_yotei" CssClass="kj0020p02_koji_yotei"
                                runat="server" ReadOnlyWidth="-2" TabIndex="29">
                                <asp:ListItem Value="0">ＮＮＮＮ</asp:ListItem>
                                <asp:ListItem Value="1">ＰＰＰＰ</asp:ListItem>
                                <asp:ListItem Value="2">ＢＢＢＢ</asp:ListItem>
                                <asp:ListItem Value="3">ＺＺＺＺ</asp:ListItem>
                                <asp:ListItem Value="4">ＭＭＭＭ</asp:ListItem>
                            </cc:ReadOnlyDropDownList>
                        </td>
                        <td class="kj0020p02_koji_yotei_mid_space">
                        </td>
                        <td class="noborder_left kj0020p02_koji_yotei_last_space">
                        </td>
                        <td colspan="3" class="noborder_left noborder_bottom">
                        </td>
                    </tr>
                    <tr>
                        <td class="label_background">
                            完了予定日
                        </td>
                        <td class="label_background noborder_left k0020p02_needmark">
                            *
                        </td>
                        <td colspan="2" class="white_td">
                            <asp:TextBox ID="txt_kanryo_yt_dt" runat="server" MaxLength="10" TabIndex="30" CssClass="kj0020p02_kanryo_yt_dt"
                                Text="9999/99/99" />
                            <ajaxToolkit:CalendarExtender ID="btn_kanryo_Calendar" CssClass="MyCalendar" runat="server"
                                DaysModeTitleFormat="yyyy/MM/dd" Enabled="True" Format="yyyy/MM/dd" PopupButtonID="btn_kanryo_dt_Calendar"
                                TargetControlID="txt_kanryo_yt_dt" TodaysDateFormat="yyyy/MM/dd">
                            </ajaxToolkit:CalendarExtender>
                        </td>
                        <td class="border_right">
                            <asp:Button ID="btn_kanryo_dt_Calendar" CssClass="calendar_button" runat="server"
                                TabIndex="31" />
                        </td>
                    </tr>
                </table>
            </div>
            <div id="mid_words">
                <table>
                    <tr>
                        <td class="kj0020p02_mid_words_part1 noborder_left noborder_bottom">
                        </td>
                        <td class="kj0020p02_mid_words_part2 noborder_left noborder_bottom">
                            業者が登録されていない場合は、業者名を入力してください。
                        </td>
                    </tr>
                </table>
            </div>
            <div class="kj0020p02_dis_between_table">
                <table>
                    <tr>
                        <td class="label_background  border_top kj0020p02_search_lable">
                            業者
                        </td>
                        <td class="label_background noborder_left border_top k0020p02_needmark">
                            *
                        </td>
                        <td class=" border_top ">
                            <asp:TextBox CssClass="kj0020p02_gyosha_cd ime_disabled" TabIndex="32" ID="txt_gyosha_cd"
                                runat="server" MaxLength="10"></asp:TextBox>
                        </td>
                        <td id="kj0020p02_gyosha_cd_top" class="border_top kj0020p02_gyosha_nm_td">
                            <asp:TextBox ID="txt_gyosha_nm" runat="server" CssClass="kj0020p02_gyosha_nm" MaxLength="50" />
                        </td>
                        <td class="kj0020p02_search_button_td">
                            <asp:Button CssClass="select_button" TabIndex="33" ID="btn_search_cd" runat="server"
                                OnClientClick="return TantoSansyo();" />
                        </td>
                        <td class="kj0020p02_sel_button_td">
                            <asp:Button CssClass="clear_button" TabIndex="35" ID="btn_tantou_sel" Text="C" runat="server" />
                        </td>
                    </tr>
                </table>
            </div>
            <div class="kj0020p02_dis_between_table">
                <table>
                    <tr>
                        <td class="noborder_left">
                        </td>
                        <td colspan="3" class="border_top border_right white_td">
                            <asp:TextBox ID="txt_gyosha_nm_part2" CssClass="kj0020p02_25_nm" runat="server" MaxLength="50"
                                TabIndex="37" />
                        </td>
                    </tr>
                    <tr>
                        <td class="label_background">
                            部署
                        </td>
                        <td colspan="3" class="border_right white_td">
                            <asp:TextBox ID="txt_post" runat="server" CssClass="kj0020p02_25_nm" MaxLength="50"
                                TabIndex="40" />
                        </td>
                    </tr>
                    <tr>
                        <td class="label_background kj0020p02_whole_search_label">
                            TEL
                        </td>
                        <td class="kj0020p02_tel_td white_td">
                            <asp:TextBox ID="txt_tel" runat="server" CssClass="kj0020p02_tel_and_fax" MaxLength="12"
                                TabIndex="42" />
                        </td>
                        <td class="noborder_bottom kj0020p02_tel_fax_front_space_td">
                        </td>
                        <td class="noborder_bottom noborder_left kj0020p02_tel_fax_behind_space_td">
                        </td>
                    </tr>
                    <tr>
                        <td class="label_background kj0020p02_whole_search_label">
                            FAX
                        </td>
                        <td class="white_td">
                            <asp:TextBox ID="txt_fax" runat="server" CssClass="kj0020p02_tel_and_fax" MaxLength="12"
                                TabIndex="45" />
                        </td>
                        <td class="kj0020p02_tel_fax_front_space_td">
                        </td>
                        <td class="noborder_bottom noborder_left kj0020p02_tel_fax_behind_space_td">
                        </td>
                    </tr>
                    <tr>
                        <td class="label_background">
                            担当者
                        </td>
                        <td colspan="2" class="white_td">
                            <asp:TextBox ID="txt_tanto_nm" runat="server" CssClass="kj0020p02_25_nm white_td"
                                TabIndex="47" MaxLength="50" />
                        </td>
                        <td class="noborder_bottom">
                        </td>
                    </tr>
                </table>
            </div>
            <div class="kj0020p02_dis_between_table">
                <table>
                    <tr>
                        <td class="label_background border_top kj0020p02_search_lable">
                            物件名
                        </td>
                        <td class="label_background noborder_left border_top k0020p02_needmark">
                        </td>
                        <td class="border_top kj0020p02_arti_and_room_cd_td">
                            <asp:TextBox ID="txt_article_cd" CssClass="kj0020p02_addtable_cd" runat="server"
                                ReadOnly="true" />
                        </td>
                        <td class="border_top border_right  kj0020p02_arti_and_room_nm_td">
                            <asp:TextBox ID="txt_article_nm" CssClass="kj0020p02_article_nm" runat="server" ReadOnly="true" />
                        </td>
                    </tr>
                    <tr>
                        <td class="label_background kj0020p02_search_lable">
                            部屋
                        </td>
                        <td class="label_background noborder_left k0020p02_needmark">
                        </td>
                        <td>
                            <asp:TextBox ID="txt_room_cd" CssClass="kj0020p02_addtable_cd" runat="server" ReadOnly="true" />
                        </td>
                        <td class="border_right">
                            <asp:TextBox ID="txt_room_nm" CssClass="kj0020p02_room_nm border_right" runat="server"
                                ReadOnly="true" />
                        </td>
                    </tr>
                    <tr>
                        <td class="label_background kj0020p02_search_lable">
                            住所
                        </td>
                        <td class="label_background noborder_left k0020p02_needmark">
                        </td>
                        <td colspan="2" class="border_right">
                            <asp:TextBox ID="txt_add_connection_location" CssClass="kj0020p02_add_connection_location"
                                runat="server" ReadOnly="true" />
                        </td>
                    </tr>
                </table>
            </div>
            <div class="kj0020p02_renraku_front_margin">
                <table>
                    <tr>
                        <td class="label_background border_top">
                            連絡先氏名
                        </td>
                        <td class="label_background noborder_left border_top">
                        </td>
                        <td colspan="2" class="border_top border_right white_td">
                            <asp:TextBox CssClass="kj0020p02_renraku" TabIndex="50" MaxLength="50" ID="txt_renraku_nm"
                                runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="label_background kj0020p02_search_lable">
                            電話番号
                        </td>
                        <td class="label_background noborder_left k0020p02_needmark">
                        </td>
                        <td class="white_td">
                            <asp:TextBox ID="txt_renraku_tel" runat="server" CssClass="kj0020p02_renraku_tel ime_disabled"
                                TabIndex="53" MaxLength="13" />
                        </td>
                        <td class="noborder_bottom kj0020p02_phone_number">
                        </td>
                    </tr>
                </table>
            </div>
            <div>
                <table id="contact_board_table">
                    <tr>
                        <td class="kj0020p02_add_label border_top label_background noborder_bottom kj0020p02_renraku_label">
                            業者連絡欄
                        </td>
                        <td class="kj0020p02_textarea_td">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="border_right">
                            <asp:TextBox ID="txt_gyosha_renraku" runat="server" TabIndex="56" MaxLength="2000"
                                CssClass="kj0020p02_textarea" TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <asp:HiddenField ID="ROWID_ANKEN" runat="server" Value="" />
    <asp:HiddenField ID="LAST_TMS_ANKEN" runat="server" Value="" />
    <asp:HiddenField ID="ROWID_TEHAI" runat="server" Value="" />
    <asp:HiddenField ID="KOJI_KB_PARA" runat="server" Value="" />
    <asp:HiddenField ID="ROW_NO_PARA" runat="server" Value="" />
</asp:Content>
